﻿using Aop.Api.Encryption;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Models;
using System.Models.Models;
using System.Text;
using System.Threading.Tasks;

namespace System.DataInitialization.ModelsData
{
    public class StaffData
    {
        private MyDbContext db;
        Staff data;
        string key = "ILIVEZENGZHIHUIL";
/*        string clearText = "欢迎访问www.tracefact.net";*/
        private CryptoHelper helper;
        public StaffData()
        {
            db = new MyDbContext();
            helper = new CryptoHelper(key);
            data = new Staff()
            {
                StaffName = "卢俊宇",
                PassWord = helper.Encrypt("990905"),
                Email = "1149036090@qq.com",
                Iphone = "16675407116",
                Sex = true,
                DepartmentRoleId = 1,
                Wages = 10000
            };
        }


        public void AddData()
        {
            db.Staffs.Add(data);
            db.SaveChanges();
            Console.WriteLine($"用户表数据添加成功{data.StaffName},{data.PassWord}");
        }

    }
}
